#include <bits/stdc++.h>
// 2025/03/10
// tag: 
// Author: Forever
using namespace std;
#pragma GCC optimize(3)
using int64 = int64_t;

int t, n, c[1001];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> t;
    while (t--){
        cin >> n;
        memset(c, 0, sizeof(c));
        for (int i = 1, x; i <= n; i++)
            cin >> x, c[x]++;
        int ans = 0, use = 0;
        for (int i = 1; i <= n; i++) {
            if (c[i] == 1)
                ans++;
            else if (c[i] >= 1)
                use++;
        }
        cout << use + ans + ans % 2 << endl;
    }
    return 0;
}